package com.tledu.zyf.util;

import java.util.Properties;

public class PropertiesUtil {
	private static Properties daoProperties = null;

	public static Properties getDaoProperties() {
		// try {
		// if (daoProperties == null) {
		// daoProperties = new Properties();
		// daoProperties.load(PropertiesUtil.class.getClassLoader()
		// .getResourceAsStream("dao.properties"));
		// }
		// } catch (Exception e) {
		// e.printStackTrace();
		// }
		// return daoProperties;
		return getDaoProperties("dao.properties");
	}

	public static Properties getDaoProperties(String path) {
		try {
			if (daoProperties == null) {
				daoProperties = new Properties();
				daoProperties.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(path));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return daoProperties;
	}
}
